package cn.lj.dict.service.service.impl;

import cn.lj.common.util.BeanCopierUtil;
import cn.lj.dict.mapper.mapper.DictMapper;
import cn.lj.dict.mapper.pojo.SmallMiDict;
import cn.lj.dict.mapper.qo.SmallMiDictQO;
import cn.lj.dict.service.bo.SmallMiDictBO;
import cn.lj.dict.service.dos.SmallMiDictDO;
import cn.lj.dict.service.service.DictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: DictMapper字典表，用来初始化数据
 * @author: lijie
 * @date: 2021年07月17日 上午 10:07:6
 */
@Service
public class DictServiceImpl implements DictService {
    @Autowired
    private DictMapper dictMapper;

    /**
     * 功能描述: 通过组查询
     *
     * @param smallMiDictBO:
     * @auther: lijie
     * @date: 2021/7/17 上午 10:24:31
     * @return: List<SmallMiDictDO>
     */
    @Override
    public List<SmallMiDictDO> groupkeys(SmallMiDictBO smallMiDictBO) {
        SmallMiDictQO smallMiDictQO = BeanCopierUtil.copyObj(smallMiDictBO, SmallMiDictQO.class);
        List<SmallMiDict> smallMiDicts = dictMapper.groupkeys(smallMiDictQO);
        List<SmallMiDictDO> smallMiDictDO = BeanCopierUtil.copyList(smallMiDicts, SmallMiDictDO.class);
        System.out.println(smallMiDictDO);
        return smallMiDictDO;
    }
}
